<?php



class ColumnModel
{
	public $EntityId;
	public $Columns;
	public $JsonColumns;
 	
	public function ColumnModel($ID){
		$this -> setJsonColumns("
								[{
							        header: '#',
							        readOnly: true,
							        dataIndex: 'IDpresident', // this is where the mapped name is important!
							        width: 50,
							        hidden: false
							      },{
							        header: 'First Name',
							        dataIndex: 'FirstName',
							        width: 150,
							        editor: new Ext.form.TextField({  // rules about editing
							            allowBlank: false,
							            maxLength: 20,
							            maskRe: /([a-zA-Z0-9\s]+)$/   // alphanumeric + spaces allowed
							          })
							      },{
							        header: 'Last Name',
							        dataIndex: 'LastName',
							        width: 150,
							        editor: new Ext.form.TextField({
							          allowBlank: false,
							          maxLength: 20,
							          maskRe: /([a-zA-Z0-9\s]+)$/
							          })
							      },{
							        header: 'ID party',
							        readOnly: true,
							        dataIndex: 'IDparty',
							        width: 50,
							        hidden: true                      // we don't necessarily want to see this...
							      },{
							        header: 'Party',
								   	dataIndex: 'PartyName',
								   	width: 150,
								   	editor: new Ext.form.ComboBox({
								         typeAhead: true,
								         triggerAction: 'all',
								         store:new Ext.data.SimpleStore({
								         fields:['partyValue', 'partyName'],
								         data: [['1','No Party'],['2','Federalist'],['3','Democratic-Republican'],['4','Democratic'],['5','Whig'],['6','Republican']]
								                }),
								         mode: 'local',
								         displayField: 'partyName',
								         valueField: 'partyValue',
								         listClass: 'x-combo-list-small'
								      })
				
							      },{
							        header: 'Income',
							        dataIndex: 'Income',
							        width: 150,
							        renderer: function(v){ return '$ ' + v; },   // we tell Ext how to display the number
							        editor: new Ext.form.NumberField({
							          allowBlank: false,
							          decimalSeparator : ',',
							          allowDecimals: true,
							          allowNegative: false,
							          blankText: '0',
							          maxLength: 11
							          })
							      }]
								");
	}

    /**
     * Gets $JsonColumns.
     * @see ColumnModel::$JsonColumns
     */
    public function getJsonColumns()
    {
        return $this->JsonColumns;
    }
    
    /**
     * Sets $JsonColumns.
     * @param object $JsonColumns
     * @see ColumnModel::$JsonColumns
     */
    public function setJsonColumns($JsonColumns)
    {
        $this->JsonColumns = $JsonColumns;
    }

    /**
     * Gets $Columns.
     * @see ColumnModel::$Columns
     */
    public function getColumns()
    {
        return $this->Columns;
    }
    
    /**
     * Sets $Columns.
     * @param object $Columns
     * @see ColumnModel::$Columns
     */
    public function setColumns($Columns)
    {
        $this->Columns = $Columns;
    }
    
    /**
     * Gets $EntityId.
     * @see ColumnModel::$EntityId
     */
    public function getEntityId()
    {
        return $this->EntityId;
    }
    
    /**
     * Sets $EntityId.
     * @param object $EntityId
     * @see ColumnModel::$EntityId
     */
    public function setEntityId($EntityId)
    {
        $this->EntityId = $EntityId;
    }
}

?>